<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">  <!-- Use Chrome Frame in IE -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <meta name="description" content="A simple CZML example showing four satellites in orbit around the Earth, and some ground objects.">
    <meta name="cesium-sandcastle-labels" content="Showcases, DataSources">
    <title>Cesium Demo</title>
    <script type="text/javascript" src="../Sandcastle-header.js"></script>
    <script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.9/require.js"></script>
    <script type="text/javascript">
    require.config({
        baseUrl : '../../../Source',
        waitSeconds : 60
    });
    </script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
    @import url(../templates/bucket.css);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar"></div>

<script id="cesium_sandcastle_script">
function startup(Cesium) {
    "use strict";
//Sandcastle_Begin
var gallery = '../../SampleData/';

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.extend(Cesium.viewerEntityMixin);

Sandcastle.addDefaultToolbarButton('Satellites', function() {
    var czmlDataSource = new Cesium.CzmlDataSource();
    czmlDataSource.loadUrl(gallery + 'simple.czml');
    viewer.dataSources.add(czmlDataSource);
});

Sandcastle.addToolbarButton('Vehicle', function() {
    var czmlDataSource = new Cesium.CzmlDataSource();
    czmlDataSource.loadUrl(gallery + 'Vehicle.czml');
    viewer.dataSources.add(czmlDataSource);
});

Sandcastle.addToolbarButton('Built-in CZML', function() {
    var builtInCzml = [{
        "id" : "document",
        "version" : "1.0"
    }, {
        "id" : "Vehicle",
        "availability" : "2012-08-04T16:00:00Z/2012-08-04T17:04:54Z",
        "billboard" : {
            "eyeOffset" : {
                "cartesian" : [0.0, 0.0, 0.0]
            },
            "horizontalOrigin" : "CENTER",
            "image" : "",
            "pixelOffset" : {
                "cartesian2" : [0.0, 0.0]
            },
            "scale" : 0.8,
            "show" : [{
                "interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
                "boolean" : true
            }],
            "verticalOrigin" : "BOTTOM"
        },
        "label" : {
            "fillColor" : [{
                "interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
                "rgba" : [255, 255, 0, 255]
            }],
            "font" : "bold 10pt Segoe UI Semibold",
            "horizontalOrigin" : "LEFT",
            "outlineColor" : {
                "rgba" : [0, 0, 0, 255]
            },
            "pixelOffset" : {
                "cartesian2" : [10.0, 0.0]
            },
            "scale" : 1.0,
            "show" : [{
                "interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
                "boolean" : true
            }],
            "style" : "FILL",
            "text" : "Vehicle",
            "verticalOrigin" : "CENTER"
        },
        "path" : {
            "material" : {
                "solidColor" : {
                    "color" : [{
                        "interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
                        "rgba" : [255, 255, 0, 255]
                    }]
                }
            },
            "width" : [{
                "interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
                "number" : 5.0
            }],
            "show" : [{
                "interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
                "boolean" : true
            }]
        },
        "position" : {
            "interpolationAlgorithm" : "LAGRANGE",
            "interpolationDegree" : 1,
            "epoch" : "2012-08-04T16:00:00Z",
            // Trimmed to just 2 points
            "cartesian" : [0.0, -2379754.6637012, -4665332.88013588, 3628133.68924173,
                           3894.0, -2291336.52323822, -4682359.21232197, 3662718.52171165]
        }
    }];
    
    var czmlDataSource = new Cesium.CzmlDataSource();
    czmlDataSource.load(builtInCzml, 'Built-in CZML');
    viewer.dataSources.add(czmlDataSource);
});

Sandcastle.reset = function() {
    viewer.dataSources.removeAll();
    viewer.homeButton.viewModel.command();
};
//Sandcastle_End
    Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
    startup(Cesium);
} else if (typeof require === "function") {
    require(["Cesium"], startup);
}
</script>
</body>
</html>
